/**
 * 
 */
package com.feonix.designPattern.singleton.sample2;

/**
 * @CopyRight (c)1993-2017
 * @Project common_practice
 * @Comments 请输入该类的描述
 * @NameSpace com.feonix.designPattern.singleton.sample2
 * @Author Feonixzw
 * @CreateDate 2018年1月31日
 */
public class TicketMaker {
	
	private int ticket = 1000;
	
	private static TicketMaker ticketMaker = new TicketMaker();
	
	private TicketMaker(){
		System.out.println("TicketMaker 实例产生");
	}
	
	public synchronized int getNextTicketNumber(){
		return ticket++;
	} 
	
	public static TicketMaker getInstance(){
		return ticketMaker;
	}


}
